using System;

namespace BGM.Domain.DTO
{
    public class Reading : IComparable<Reading>
    {
        protected DateTime timeStamp;
        protected double value;

        public DateTime TimeStamp
        {
            get { return timeStamp; }
            set { timeStamp = value; }
        }
        public double Value
        {
            get { return this.value; }
            set { this.value = value; }
        }


        public Reading()
        {

        }
        public Reading(DateTime timeStamp, double value)
        {
            this.timeStamp = timeStamp;
            this.value = value;
        }

        #region IComparable<Reading> Members

        public int CompareTo(Reading other)
        {
            return this.timeStamp.CompareTo(other.TimeStamp);
        }

        #endregion
        public override bool Equals(object obj)
        {
            Reading o = obj as Reading;
            if (o != null)
                return this.timeStamp.Equals(o.TimeStamp) && this.value.Equals(o.Value);
            else
                return base.Equals(obj);
        }
    }
}
